***********spruce up cost data***********
import delimited "$data/CCC/childcare_costs_2018.csv", clear
replace v1 = subinstr(v1, " (tie)", "", .)
gen state = word(v1, 2)
replace state = word(v1, 2) + " " +  word(v1, 3) if wordcount(v1) == 4
gen cost = word(v1, -1)
drop v1
replace cost = subinstr(cost, "\$", "", .)
replace cost = subinstr(cost, ",", "", .)
destring cost, replace
replace state = subinstr(state, ":", "", .)
replace state = "District of Columbia" if strpos(state, "D.C")

//get fips codes
ren state state_full
merge 1:1 state_full using "$data/Crosswalks/state_fips_crosswalk", keep(match) nogen
drop if statefips == 11
ren cost ccc
xtile ccc_quant = ccc, nq(2)

preserve
replace ccc = ccc/1000
//maptile ccc, geo(state) rev n(9) legdecimal(1)
//graph export "$output/state_ccc.png", replace

//maptile ccc_quant, geo(state) rev n(3) legdecimal(1)
//graph export "$output/state_ccc_quant.png", replace

//graph close
restore

keep ccc* statefips
save "$temp/state_ccc", replace